const {
	createApp
} = Vue;
var app = createApp({
	data() {
		return {
			batch: {
				id: 0,
				pdfList: []
			},
			statusList: []
		}
	},
	methods: {
		test: function() {
			axios.post('/makeup/batch/manual/step1?id=' + this.batch.id, {}).then(function(response) {})
				.catch(function(error) {
					console.log("error", error);
				})
		},buildPdf: function(id) {
			axios.post('/makeup/batch/manual/pdf/build?id=' + id, {}).then(function(response) {})
				.catch(function(error) {
					console.log("error", error);
				})
		}
	},
	watch: {
		selector: {
			handler: function(nv, ov) {},
			deep: true
		}
	}
}).mount('#app');


function loadData() {
	var selector = {
		id: _QS['id'],
		withPdfIdList: 1,
		withTradeIdList: 1,
		withGroupIdList: 1,
		withPdfList: 1
	}
	axios.post('/makeup/batch/get?id=' + _QS['id'], selector).then(function(response) {
		console.log("response", response)
		app.$data.batch = response.data.data || {};
		var batch = app.$data.batch;
		if (!app.$data.statusList.length && response.data.statusList) {
			app.$data.statusList = response.data.statusList;
		}

		//app.$data.request.fromStatus = batch.status;
	}).catch(function(error) {
		console.log("error", error);
	});
}

window.addEventListener("load", loadData);

//httpPost("/makeup/batch/manual/step1?id=582710814801268736",{target:{scene:'pay'}})

export {
	app
}